package com.card.game;

import java.util.List;
import java.util.Vector;

/**   
 * @Description: TODO(用一句话描述该文件做什么) 
 * @author siyunlong  
 * @date 2016年8月13日 下午12:56:54 
 * @version V1.0   
 */
public class Hand {
	public Vector<Card> cards = new Vector<>();
	
	public boolean isHu() {
		return false;
	}
	
	public Hand() {
	}

	public Hand(Vector<Card> cards) {
		this.cards = cards;
	}
	
//	public boolean isCanHu(Card outCard) {
//		Vector<Card> copyCards = (Vector<Card>)cards.clone();
//		copyCards.add(outCard);
//		return HandUtils.isHuPai(copyCards);
//	}
	public boolean isDuiHu(Card outCard) {
		if(cards.size() < 13) {
			return false;
		}
		Vector<Card> copyCards = (Vector<Card>)cards.clone();
		copyCards.add(outCard);
		return HandUtils.allIsDui(copyCards);
	}
	public List<CardHeap> getCanChiList(Card outCard) {
		return QzUtils.getCanChiList(cards, outCard);
	}
//	public boolean isZimo() {
//		Vector<Card> copyCards = (Vector<Card>)cards.clone();
//		return HandUtils.isHuPai(copyCards);
//	}
	
	public boolean isDuiZimo() {
		return HandUtils.allIsDui(cards);
	}
	
	public boolean isCanMingGang(Card outCard) {
		return HandUtils.isCanMingGang(cards, outCard);
	}
	
	public boolean isCanDui(Card outCard) {
		return HandUtils.isCanDui(cards, outCard);
	}
	
	public Card firstElement() {
		return cards.firstElement();
	}

	@Override
	public String toString() {
		return "Hand [cards=" + cards + "]";
	}
	
	public void clear() {
		this.cards.clear();
	}
}
